package com.company;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        //案例-字符相加
        String i = "中";
        String j = "国";
        System.out.println("=" + (i + j));
        char a = 'A';   //字母Ascll码值
        char b = '3';   //数字Ascll码值
        System.out.println("=" + (a + b));


        //案例-常量
        final double PI = 3.14159265;
        double r = 5;
        double perimeter = 2 * PI * r;
        double area = PI * r * r;
        System.out.println("圆的周长 C=" + perimeter);
        System.out.println("圆的面积 S=" + area);


        //案例-Scanner
        String name = "小明";
        int age = 25;
        System.out.println("请输入工作年份：");
        System.out.println("请输入做过几个项目：");
        Scanner input = new Scanner(System.in);
        int gangling = input.nextInt();
        int xiangmu = input.nextInt();
        System.out.println("工作了" + gangling + "年");
        System.out.println("做过" + xiangmu + "个项目");
        System.out.println("姓名：" + name);
        System.out.println("年龄：" + age);

        //Scanner input=new Scanner(System.in)
        //String name=input.next()
        //int age=input.nextInt()
        //char sex=input.next().charAt(0)
        //double score=input.nextDouble()


    }
}

